# conding = utf-8
# 读取用例文件
import os

import yaml

from config import cases_url


def load_cases():
    '''
    加载工程中所有用例文件
    :return:
    '''
    cases = []
    # 读取指定目录下的所有内容
    for root, dirs, files in os.walk(cases_url):
        for file in files:
            if ".yml" in file or ".yaml" in file:
                with open(f"{root}/{file}","r",encoding="utf-8") as case:
                    content = yaml.safe_load(case)
                    cases += content
    return cases;
